package com.estate.report.mapper;

import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.estate.common.core.domain.BaseEntity;
import com.estate.report.domain.DataStatistics;
import com.estate.report.domain.RateSourceDataBo;
import com.estate.report.domain.dto.DataStatisticsDto;
import com.estate.report.domain.dto.DataStatisticsListDto;
import com.estate.report.domain.dto.PerformanceStatisticsDto;
import com.estate.report.domain.vo.PerformanceDetailVo;
import com.estate.report.domain.vo.PerformanceVo;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 数据统计mapper
 *
 * @author jpp
 * @since  2025/10/26
 */
public interface DataStatisticsMapper extends BaseMapper<DataStatistics> {

    int saveBatch(@Param("list") List<DataStatistics> list);

    List<DataStatistics> executeSql(String sql);

    BigDecimal getSum(@Param("req")DataStatisticsDto req, @Param("dataScope") BaseEntity dataScope);

    Integer getCount(@Param("req")DataStatisticsDto req, @Param("dataScope") BaseEntity dataScope);

    List<BigDecimal> getPriceList(@Param("req")DataStatisticsDto req, @Param("dataScope") BaseEntity dataScope);

    List<JSONObject> getDataList(@Param("req") DataStatisticsListDto req, @Param("dataScope") BaseEntity dataScopeEntity);

    List<RateSourceDataBo> getRateSourceList(@Param("req") DataStatisticsListDto req, @Param("dataScope") BaseEntity dataScopeEntity);

    List<PerformanceVo> getPerformanceData(@Param("req") PerformanceStatisticsDto req, @Param("dataScope") BaseEntity dataScope);

}
